package com.songtech.server.frame.protocal;


import com.songtech.server.entry.BaseProtocal;

import java.time.LocalTime;

/**
 * Create By YINN on 2018/4/6 20:51
 * Description : 将各协议实体类 统一装配
 */
public class AssembleFactory {

    /**
     * Created by YINN on 2018/4/8 14:37.
     * @Description : 将BaseProtocal及其各个子类传入，统一赋值
     * @param t 泛型
     * @param manufacturer 制造厂商
     * @param imei 身份标识
     * @param cmd 命令体
     * @param cmdTime 命令时间
     * @param cmdParam 命令参数
     * @Result :
     */
    public static <T extends BaseProtocal> T assemble(T t, String manufacturer, String imei,
                                                      String cmd, LocalTime cmdTime, String[] cmdParam) {

        t.setAll(manufacturer, imei, cmd, cmdTime, cmdParam);
        return t;
    }
}
